<script src="./css/base/bootstrap/js/jquery-1.10.1.js"></script>
<script src="./js/project.js"></script>

<link href="./css/index_5.css" rel="stylesheet">


<div class="col-sm-10">
    <ol class="breadcrumb">
        <li class="active">下载管理
        </li>
        <li class="active">下载列表
        </li>
    </ol>
    <div class="panel panel-default hidden ">
        <div class="panel-heading">
            搜索
        </div>
        <div class="panel-body">



            <!--########################################-->
            <?php
            use yii\widgets\ActiveForm;

            $form=ActiveForm::begin(
                ['options'=>[
                    'enctype'=>'multipart/form-data',
                    'class' => 'form-inline line-block',

                ],
                    'method'=>'get',
                    "action"=>"/index.php?r=home/searchproject",
                ]
            );

            ?>

            <?=$form->field($model,'key')->textInput(['maxlength' => 255,'name'=>"key",'style'=>"width:300px;float: right;margin-right:4px","value"=>isset($key)?$key:''])->label(false);?>
            <button type="submit" class="btn btn-default" style="float: right" >开始搜索</button>

            <?php ActiveForm::end(); ?>
            <button class="btn btn-danger" onclick="batch_delete_project()" style="margin-left: 100px">批量删除</button>
            <!--########################################-->

        </div>
    </div>

    <!--
        列表展示
    -->
    <div class="table-responsive">
        <table class="table table-striped ">
            <thead>
            <tr>
                <!--<th><input type="checkbox" id="selectall"> 全选</th>-->
                <th><input type="checkbox" id="selectall" onchange="selectall(this)"> 全选</th>
                <th>编号</th>
                <th>key</th>
                <th>文件数量</th>
                <th>文件大小</th>
                <th>存储路径</th>
                <th>压缩完成率</th>
                <th>自动删除日期</th>

                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            <!--从这里开始遍历数据-->
            <?php foreach($downloads as $download): ?>

                <tr>
                    <td><input type="checkbox" class="item"   ></td>
                    <td> <?=$download->id?> </td> <!--id-->

                    <td><?=$download->key?>  </td> <!--下载名-->
                    <td><?=$download->filecount?>  </td> <!--文件数量-->
                    <td><?=echoFileSize($download->filesize);?> </td> <!--文件大小-->
                    <td> <?=$download->path?> </td> <!--下载描述-->
                    <td> <?php
                        if($download->zip_percentage==0){
                            echo 0;
                        }else{
                            echo $download->zip_percentage;
                        }

                        ?> </td> <!--压缩完成率-->
                    <td> <?=date('Y-m-d H:i:s',$download->deletetime)?> </td> <!--自动删除日期-->

                    <td class="text-center col-md-2">

                        <a style="display: none" href="/index.php?r=home/download&id=<?=$download->id?>" class="btn btn-success" >下载</a>
                        <a href="<?=$download->path?>" class="btn btn-success" >查看</a>
                        <button class="btn btn-danger" onclick="delete_download(this,<?=$download->id?>)">删除</button>

                    </td>
                </tr>
            <?php endforeach; ?>


            <!--到这里结束遍历数据-->
            </tbody>
        </table>
    </div>
</div>
</div>
</div>